function dealPayloadParams(payload, params = {}, curIsFinished = false) {
  if (Object.keys(params).length === 0) {
    payload.page = 1;
  } else if (payload.page == 1) {
    //重新从第一页开始获取数据
    return false;
  } else {
    let isParamsChanged = false;
    if (payload.hasOwnProperty('page') != true) {
      payload.page = params.page;
    }
    for (let key in payload) {
      if (params.hasOwnProperty(key) != true || payload[key] !== params[key]) {
        isParamsChanged = true;
      }
    }
    for (let key in params) {
      if (payload.hasOwnProperty(key) != true || payload[key] !== params[key]) {
        isParamsChanged = true;
      }
    }
    if (isParamsChanged) {
      //参数变了，获取第一页数据
      payload.page = 1;
    } else {
      //参数未变，获取下一页数据
      if (curIsFinished) {
        //所有页面数据已获取完
        return true;
      }
      payload.page = params.page + 1;
    }
  }
  return false;
}

export { dealPayloadParams };
